package com.example.shorg.controller;

import com.example.shorg.dataobject.BannerBean;
import com.example.shorg.service.BannerService;
import com.example.shorg.utils.ResultVOUtils;
import com.example.shorg.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 首页controller
 * */
@RestController
@RequestMapping("/home")
public class HomeController {

    @Autowired
    public BannerService bannerService;

    /**
     * 获取首页轮播图列表
     * */
    @RequestMapping("/banner/list")
    public ResultVO getBannerList(){
        List<BannerBean> all = bannerService.findAll();
        return ResultVOUtils.success(all);
    }
}
